
using CStock;
using System;
using System.Diagnostics;

using NUnit.Framework;
namespace TestCases.StockData
{
	

	/// <summary>Some simple Tests.</summary>
	/// 
	[TestFixture]
    public class TraderTest : TestCases.StockData.ProgramContext_TestCases
	{

        private const string traderName = "Eddies";
        
        ITraderFactory traderFactory;
       
		

        public TraderTest()
		{
            traderFactory = new TraderFactory();
            traderFactory.Create(traderName);

			
        }

      
        [Test]
        public void Trader_Create_And_Save()
        {
            traderFactory.AddDefaultPortfolio();
            Assert.IsTrue(this.traderFactory.Serialize());

        }
      
     
		
		[Test] 
		public void DeSerializeTest()
		{
            Assert.IsTrue(this.traderFactory.DeSerialize());

          
		}

        [Test]
        public void Create_Default()
        {
            TradeSystemFactory tradeSystemFactory = new TradeSystemFactory();
            tradeSystemFactory.Create(traderName);
            traderFactory.AddDefaultSystem();

        }
        [Test]
        public void Create_Test_Save()
        {
            TraderFactory traderFactory = new TraderFactory();
            traderFactory.Create(traderName);
            traderFactory.Create_TestData();

            Assert.IsTrue(traderFactory.Serialize());

        }
	
	}

	
}